import time

from selenium import webdriver
from selenium.webdriver.common.by import By

driver = webdriver.Chrome()
driver.get("https://baidu.com/")
# 绝对路径
# driver.find_element(By.XPATH, "html/body/div/div/div[3]/a[3]").click()
# 根据id定位
# driver.find_element(By.XPATH,"//input[@id='kw']").send_keys("selenium")
# 根据class属性定位
# driver.find_element(By.XPATH,"//input[@class='s_ipt']").send_keys("selenium")
# 根据name定位
# driver.find_element(By.XPATH,"//input[@name='wd']").send_keys("selenium")
# 多个属性组合定位
# driver.find_element(By.XPATH, "//input[@name='wd' and @class='s_ipt']").send_keys("selenium")
# 多种数据使用下标定位
# driver.find_element(By.XPATH, "//div[@id='s-top-left']/a[4]").click()
# 通过子元素找父元素 文本等于 查到的元素从0开始下标
# driver.find_element(By.XPATH, "//span[text()='高仿LV包装只需30元']").click()
# 文本包含
# driver.find_element(By.XPATH, "//span[contains(text(),'高仿LV')]").click()
time.sleep(3)
driver.quit()
